﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ImageRecognition2.Action
{
    /// <summary>
    /// This is the abstract command class.
    /// This is used for implementation of the command pattern.
    /// </summary>
    public abstract class AbstractCommand : ICommand
    {
        private object m_oOwner = null;
        private string m_sDescription = string.Empty;
        protected object m_oResult = null;

        /// <summary>
        /// Gets or sets the owner.
        /// </summary>
        /// <value>The owner.</value>
        public object Owner
        {
            get { return m_oOwner; }
            set { m_oOwner = value; }
        }

        /// <summary>
        /// Gets the result.
        /// </summary>
        /// <value>The result.</value>
        public object Result
        {
            get { return m_oResult; }
        }

        /// <summary>
        /// Gets or sets the description.
        /// </summary>
        /// <value>The description.</value>
        public string Description
        {
            get { return m_sDescription; }
            set { m_sDescription = value; }
        }

        /// <summary>
        /// Runs the specified sender.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        public abstract void Run(object sender, EventArgs e);

        /// <summary>
        /// Used to create a deep copy
        /// </summary>
        /// <returns></returns>
        public virtual object Clone()
        {
            //Because this is the abstract class it has to be like this here....
            throw new NotImplementedException();
        }
    }
}
